# ID-Card API Documentation

We provide a test-environment for Merchants to test the integration.
It includes test users with different age and genders, so that we can generate QRCodes for testing purposes.

## Session Response Model

We only return the data requested by the scope provided in the **access token**. The content of the response model will then very depending on the Merchants needs, but a full model looks like this:

> **Session Response Model**
>
> ```json
> {
>     "firstName": "string",
>     "lastName": "string",
>     "documentPhoto": "string",
>     "age": int,
>     "phoneNumber": "string"
> }
> ```

Here is a table of what you can expect to be returned depending on your scope.
All properties will be returned at all times, but the value will be empty if its not part of your scope.

| Name          | Type            | Description                         | age_only | identity_basic | picture_age | identity_full | phone_number |   |
| ------------- | --------------- | ----------------------------------- | -------- | -------------- | ----------- | ------------- | ------------ | - |
| firstName     | string          | First name                          | ❌        | ✅              | ❌           | ✅             | ❌            |   |
| lastName      | string          | Last name                           | ❌        | ✅              | ❌           | ✅             | ❌            |   |
| documentPhoto | string (base64) | Identity document's photograph      | ❌        | ❌              | ✅           | ✅             | ❌            |   |
| age           | string          | Age of user                         | ✅        | ✅              | ✅           | ✅             | ❌            | ❌ |
| phoneNumber   | string          | Phone number with country code (47) | ❌        | ❌              | ❌           | ❌             | ✅            |   |

> **Warning**
>
> This is subject to change. See [Release note](https://docs.stoe.no/id-card/release-notes.md) to stay updated.

## Environments

ID-Card API is available through different base URLs for our different environments. To access the API, combine the **base URL + endpoint** like this:  `base URL` + `/api/merchant/session/`.

### Environment URLs - Test

- ID-Card Base URL: `https://visleg-test-merchantservice-cnhvehb0cvdgggah.z01.azurefd.net`
- BankID OIDC Config: `https://auth.current.bankid.no/auth/realms/current/.well-known/openid-configuration`

### Environment URLs - Production

- ID-Card Base URL: `SENT PRIVATELY`
- BankID OIDC Config: `https://auth.bankid.no/auth/realms/prod/.well-known/openid-configuration`

## Merchant Integration API

> **Testing**
>
> For documentation on how to use QRCode test endpoint, see [Testing the API](https://docs.stoe.no/id-card/getting-started/testing-api.md)

API reference: [OpenAPI specification](https://docs.stoe.no/id-card/API/merchant-swagger.json)

> **Live API documentation**
>
> The live API swagger documentation for the ID-Card API can be found [here.](https://visleg-test-merchantservice-cnhvehb0cvdgggah.z01.azurefd.net/api/swagger/ui)
> This can deviate from this documentation as it us under development.
